
//判断是否已经登录了
function islogin() {
  let username = sessionStorage.getItem('username') || localStorage.getItem('username');
  if (!username) {
    location.href = 'login.html';
  }
  else {
    $("#currentUser").html(username);
  }
}

islogin()


// 退出登录
$('#logout').click(function(){
  sessionStorage.removeItem('username');
  localStorage.removeItem('password');
  islogin();
})
